<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>背景颜色变化</title>
    <style type="text/css">
        .red{
            font-size: 28px;
            color: red;
        }
    </style>
</head>
<body>
<input type="button" value="点我吧">
<p>我一会显示一会隐藏</p>
<script src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
      $("input").toggle(
        function(){
            $("body").css("background","#ff0000");
        },
        function(){
            $("body").css("background","#00ff00");
        },
        function(){
            $("body").css("background","#0000ff");
        }
      )

    //$("input").click(function(){$("p").toggle();})

    $("input").click(function(){$("p").toggleClass("red");})


    })
</script>
</body>
</html>